%% it produces Figure 8

c_s_ss=y_s_vec(1,1)*(1-inve_s_vec(1,1));
c_n_ss=y_n_vec(1,1)*(1-inve_n_vec(1,1));
c_ss  = .5*(c_n_ss+c_s_ss);

%index of optimal policy (computed in dynamic environment)
inde_tau=find(tau_vec==0,1);
[mm,inde2]=max(W_vec_ss(inde_tau,:));
inde2=find(k_vec==0.7);

figure(10)
plot(100*(1-k_vec),(debt0_va_s_vec(inde_tau,:)),'--r','Linewidth',6),hold on
plot(100*(1-k_vec),(debt0_va_n_vec(inde_tau,:)),'-b','Linewidth',6),hold off
le=legend('South','North')
set(le,'Interpreter','Latex','Fontsize',16);
xlabel('Subsidy $\vartheta+\tau$, \%','Fontsize',18,'Interpreter','Latex')
ylabel('Average debt at entry: $b_0$','Fontsize',18,'Interpreter','Latex')
settt
grid on
str1="/figures/figure_10.pdf";
str_save1=append(root,str1);
print(gcf,'-dpdf',str_save1)

figure(15)
plot(100*(1-k_vec),(R_vec_s(inde_tau,:)),'--r','Linewidth',6),hold on
plot(100*(1-k_vec),(R_vec_n(inde_tau,:)),'-b','Linewidth',6),hold off
le=legend('South','North')
set(le,'Interpreter','Latex','Fontsize',16);
xlabel('Subsidy $\vartheta+\tau$, \%','Fontsize',18,'Interpreter','Latex')
ylabel('Profit per unit of Z: $\mu$','Fontsize',18,'Interpreter','Latex')
settt
grid on
str1="/figures/figure_15.pdf";
str_save1=append(root,str1);
print(gcf,'-dpdf',str_save1)

figure(20)
plot(100*(1-k_vec),(l_s_vec(inde_tau,:)),'--r','Linewidth',6),hold on
plot(100*(1-k_vec),(l_n_vec(inde_tau,:)),'-b','Linewidth',6),hold on
xlabel('Subsidy $\vartheta+\tau$, \%','Fontsize',18,'Interpreter','Latex')
ylabel('Workers','Fontsize',18,'Interpreter','Latex')
le=legend('South','North')
set(le,'Interpreter','Latex','Fontsize',16);
settt
grid on
str1="/figures/figure_20.pdf";
str_save1=append(root,str1);
print(gcf,'-dpdf',str_save1)

